//
//  ViewController.m
//  tagpoint-2
//
//  Created by 崔博 on 2018/9/13.
//  Copyright © 2018年 崔博. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (nonatomic, copy) NSString * name;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    dispatch_queue_t queue = dispatch_get_global_queue(0, 0);
//    for (int i = 0; i < 1000; i++) {
//        dispatch_async(queue, ^{
//            // 加锁
//            self.name = [NSString stringWithFormat:@"123123123"];
//            // 解锁
//        });
//    };
        dispatch_queue_t queue = dispatch_get_global_queue(0, 0);
        for (int i = 0; i < 1000; i++) {
            dispatch_async(queue, ^{
                // 加锁
                self.name = [NSString stringWithFormat:@"1"];
                // 解锁
            });
        };
    // 当储存小对象的

}
@end
